package com.javaooptwo;

import java.util.Scanner;

public class User {
    int id;
    String name;
    String password;

    public User() {
    }

    public User(String name, String password) {
        this.name = name;
        this.password = password;
    }

    //参数列表：形参
    public int  login(User user){
        int id=10;
        int isOk=0;
        if(user.name.equals("admin") && user.password.equals("123")){
            System.out.println("登录成功...");
            isOk=1;
        }else {
            System.out.println("登录失败..."+id);
        }
        return isOk;
    }

    public boolean login(int id,String uname){

        boolean isOK=false;
         if(uname.equals("admin")){
             isOK=true;
             System.out.println("登录成功..");
         }
         return isOK;
    }

    public void login(String uname,int id){
        System.out.println("登录成功..");
    }


    //打印用户信息
    public void printUser(User[] users){
        users[0].name="ww";
        System.out.println("用户名\t\t\t密码");
        for (int i = 0; i <users.length ; i++) {
            System.out.println(users[i].name+"\t\t\t"+users[i].password);
        }
    }

    public void getAge(int age){
        age++;
        System.out.println(age);
    }

    public void getUser(User user){
        user.name="zs";
        System.out.println(user);
    }

}
